<!DOCTYPE html>
<html>
{include file="head.html"}
<body>
<div class="body">
<div class="header">
    <a href="{$appkoudai}?m=index"  class="left-btn"><span class="iconfont icon-back"></span></a>
    <div class="title">进货</div>
    <a href="{$appkoudai}?m=koudai_product&a=add" class="right-btn"><span class="iconfont icon-upload"></span></a>
  </div>
<div class="main-body ">
	 <div class="tabs-border">
     <a  class="item">进货渠道</a>
     	{foreach item=c from=$kucunlist}
        <a href="{$appkoudai}?m=koudai_product&a=order&kcid={$c.kcid}" class="item {if $c.kcid eq $kcid}active{/if}">{$c.title}</a>
        {/foreach}
     </div>
    <style>
 	 
		.plist .item .num{width:30px; margin-right:10px; height:20px;}
		.plist .item .kcid{width:60px; margin-right:10px; height:22px;}
    </style>
    <div class="plist">
    <form method="post" action="{$appymadmin}?m=kcorder_cart&a=saveAll">
    
    	{foreach item=c from=$data}
        <div class="item">
        	<div class="g-sd1">
            	<img src="{$c.imgurl|images_site}.100x100.jpg">
                  
            </div>
            <div class="g-mn1">
            	<div class="g-mn1c">
                	<div class="title">{$c.title}</div>
                    <div>{$c.kc_title}</div>
                    <div class="row-price">
                    	<span> 库存：{$c.kc_total_num} </span> 
                        <span>销量：{$c.buy_num}</span> 
                        <span>￥{$c.price}元</span>                         
                        </div>
                                          
                    <div class="pro">
                    口袋库存：{$c.total_num} 
                    <input type="text" name="nums[{$c.productid}]" class="num" value="0">
                    <label>{$c.jh_notenum}</label>
                    <input type="hidden" name="ids[{$c.productid}]" value="{$c.id}">
                     <input type="hidden" name="kcid" value="{$kcid}"> 
                    </div>
                </div>
               
            </div>
             <div class="clearfix"></div>
        </div>
    	{/foreach}
        	<button type="submit" class="btn btn-row">确认进货</button>
        </form>
    </div>

	 
</div>
<script>
$(function(){
	$(document).on("click",".addProduct",function(){
		var obj=$(this);
		$.get("{$appkoudai}?m=koudai_product&a=addProduct&ajax=1&productid="+$(this).attr("productid")+"&kcid="+$(this).attr("kcid")+"&total_num="+$(this).siblings(".num").val()+"&catid="+$(this).siblings(".catid").val(),function(data){
			skyToast(data.message);
		},"json");
		
	});
});
</script>  
</div>

</div> 
{include file='footer.html'}